<?php

use app\http\middleware\Adminlogin;
use think\facade\Route;

Route::group('admin',function(){
	//不需要验证的
	Route::rule('/','admin/login/index');//登录页面
	Route::rule('login','admin/login/login');//登录
	Route::rule('loginout','admin/login/loginout');//退出

	Route::rule('image','admin/upload/image');//上传图片

	//需要验证中间件的
	Route::group(['middleware' => [Adminlogin::class]], function () {

		Route::rule('index','admin/index/index');//后台首页
		Route::rule('home','admin/index/home');//后台默认页
		Route::rule('clearcache','admin/index/clearcache');//清除缓存

		Route::rule('system/index','admin/system/index');//系統设置

		Route::rule('admin/index','admin/admin/index');//管理员列表
		Route::rule('admin/add','admin/admin/add');//添加
		Route::rule('admin/edit','admin/admin/edit');//编辑
		Route::rule('admin/delete','admin/admin/delete');//删除
		Route::rule('admin/setStatus','admin/admin/setStatus');//设置状态

		Route::rule('user/index','admin/user/index');//会员列表
		Route::rule('user/delete','admin/user/delete');//删除
		Route::rule('user/setStatus','admin/user/setStatus');//设置状态
		Route::rule('user/setAudit','admin/user/setAudit');//审核

		Route::rule('advert/index','admin/advert/index');//广告列表
		Route::rule('advert/add','admin/advert/add');//添加
		Route::rule('advert/edit','admin/advert/edit');//编辑
		Route::rule('advert/delete','admin/advert/delete');//删除
		Route::rule('advert/setStatus','admin/advert/setStatus');//设置状态

		Route::rule('car/index','admin/car/index');//发布列表
		Route::rule('car/delete','admin/car/delete');//删除
		Route::rule('car/setStatus','admin/car/setStatus');//设置状态
		Route::rule('car/setAudit','admin/car/setAudit');//审核

		Route::rule('carModel/index','admin/carModel/index');//车型列表
		Route::rule('carModel/add','admin/carModel/add');//添加
		Route::rule('carModel/edit','admin/carModel/edit');//编辑
		Route::rule('carModel/delete','admin/carModel/delete');//删除
		Route::rule('carModel/setStatus','admin/carModel/setStatus');//设置状态

		Route::rule('carBrand/index','admin/carBrand/index');//品牌列表
		Route::rule('carBrand/add','admin/carBrand/add');//添加
		Route::rule('carBrand/edit','admin/carBrand/edit');//编辑
		Route::rule('carBrand/delete','admin/carBrand/delete');//删除
		Route::rule('carBrand/setStatus','admin/carBrand/setStatus');//设置状态

		Route::rule('feedback/index','admin/feedback/index');//意见反馈列表
		Route::rule('feedback/delete','admin/feedback/delete');//删除
		Route::rule('feedback/setStatus','admin/feedback/setStatus');//设置状态

	});
});